package com.gtw.modules.api.controller;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.plugins.Page;
import com.gtw.common.annotation.AuthIgnoreApi;
import com.gtw.common.utils.Query;
import com.gtw.common.utils.R;
import com.gtw.dto.TbCommodityDto;
import com.gtw.modules.api.service.TbSalesLogService;
import com.gtw.modules.entity.TbCommodity;
import com.gtw.modules.entity.TbCommodityProperty;
import com.gtw.modules.entity.TbProperty;
import com.gtw.modules.entity.TbSalesLog;
import com.gtw.utils.EntityDtoConverter;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author wuye
 * @email www.baidu.com
 * @date 2018-04-17 16:01:15
 */
@RestController
@RequestMapping("saleslog")
public class TbSaleslogController {
    @Autowired
    private TbSalesLogService tbSalesLogService;

    /**
     * 列表
     */
    @AuthIgnoreApi
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params) {
        //查询列表数据
        Query query = new Query(params);
        Page<TbSalesLog> pageUtil = new Page<TbSalesLog>(query.getPage(), query.getLimit());
        Page<TbSalesLog> page = tbSalesLogService.queryPageList(pageUtil, query);
        return R.ok().put("data", page);
    }
}
